﻿<ResourceDictionary
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
	xmlns:tb="http://www.hardcodet.net/taskbar"
	xmlns:local="clr-namespace:FBApp"	    
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:Microsoft_Windows_Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d">
		
	<!-- Resource dictionary entries should be defined here. -->
		
	<BooleanToVisibilityConverter
      x:Key="BooleanToVisibilityConverter" />

    <tb:TaskbarIcon
        x:Name="tb"
        x:Key="tb"
        VerticalAlignment="Top"
        IconSource="Images/tray_icon.ico"        
        ToolTipText="Facebook Desktop Notifier"
        Visibility="{Binding IsChecked, Converter={StaticResource BooleanToVisibilityConverter}, ElementName=iconVisibility, Mode=Default}"
        MenuActivation="{Binding SelectedItem, ElementName=lstMenuTrigger, Mode=Default}"
	    PopupActivation="{Binding SelectedItem, ElementName=lstPopupTrigger, Mode=Default}" 
        
	    DoubleClickCommandParameter="{Binding RelativeSource={RelativeSource Self}}"        
        >

        <tb:TaskbarIcon.ContextMenu>
            <ContextMenu>
                <MenuItem Header="Close"/>
            </ContextMenu>
        </tb:TaskbarIcon.ContextMenu>

    </tb:TaskbarIcon>
	<Style x:Key="ButtonFocusVisual">
		<Setter Property="Control.Template">
			<Setter.Value>
				<ControlTemplate>
					<Rectangle Margin="2" SnapsToDevicePixels="true" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" StrokeThickness="1" StrokeDashArray="1 2"/>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	<LinearGradientBrush x:Key="ButtonNormalBackground" EndPoint="0,1" StartPoint="0,0">
		<GradientStop Color="#F3F3F3" Offset="0"/>
		<GradientStop Color="#EBEBEB" Offset="0.5"/>
		<GradientStop Color="#DDDDDD" Offset="0.5"/>
		<GradientStop Color="#CDCDCD" Offset="1"/>
	</LinearGradientBrush>
	<SolidColorBrush x:Key="ButtonNormalBorder" Color="#FF707070"/>
	<Style x:Key="FacebookButtonStyle" TargetType="{x:Type Button}">
		<Setter Property="FocusVisualStyle" Value="{StaticResource ButtonFocusVisual}"/>
		<Setter Property="Background" Value="{StaticResource ButtonNormalBackground}"/>
		<Setter Property="BorderBrush" Value="{StaticResource ButtonNormalBorder}"/>
		<Setter Property="BorderThickness" Value="1"/>
		<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
		<Setter Property="HorizontalContentAlignment" Value="Center"/>
		<Setter Property="VerticalContentAlignment" Value="Center"/>
		<Setter Property="Padding" Value="1"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type Button}">
					<Microsoft_Windows_Themes:ButtonChrome x:Name="Chrome" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" RenderPressed="{TemplateBinding IsPressed}" RenderDefaulted="{TemplateBinding IsDefaulted}" SnapsToDevicePixels="true" Cursor="Hand">
						<VisualStateManager.VisualStateGroups>
							<VisualStateGroup x:Name="CommonStates">
								<VisualState x:Name="Normal"/>
								<VisualState x:Name="MouseOver"/>
								<VisualState x:Name="Pressed"/>
								<VisualState x:Name="Disabled"/>
							</VisualStateGroup>
							<VisualStateGroup x:Name="FocusStates">
								<VisualState x:Name="Unfocused"/>
								<VisualState x:Name="Focused"/>
							</VisualStateGroup>
							<VisualStateGroup x:Name="ValidationStates">
								<VisualState x:Name="Valid"/>
								<VisualState x:Name="InvalidFocused"/>
								<VisualState x:Name="InvalidUnfocused"/>
							</VisualStateGroup>
						</VisualStateManager.VisualStateGroups>
						<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
					</Microsoft_Windows_Themes:ButtonChrome>
					<ControlTemplate.Triggers>
						<Trigger Property="IsKeyboardFocused" Value="true">
							<Setter Property="RenderDefaulted" TargetName="Chrome" Value="true"/>
						</Trigger>
						<Trigger Property="ToggleButton.IsChecked" Value="true">
							<Setter Property="RenderPressed" TargetName="Chrome" Value="true"/>
						</Trigger>
						<Trigger Property="IsEnabled" Value="false">
							<Setter Property="Foreground" Value="#ADADAD"/>
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	<DataTemplate x:Key="notificationTemplate">
		<Grid Margin="0" Height="Auto" d:DesignWidth="446" d:DesignHeight="40">
			<Image x:Name="img" HorizontalAlignment="Left" Margin="8,8,0,8" Width="17" VerticalAlignment="Top" Height="17" Source="{Binding Path=Avatar, Mode=OneWay}"/>
			<TextBlock x:Name="txtNotification" TextWrapping="Wrap" Text="{Binding Path=Message, Mode=OneWay}" Margin="29,8,9,6" d:LayoutOverrides="Height" Foreground="#FF3B5998" FontFamily="lucida grande"/>
		</Grid>
	</DataTemplate>
	<ControlTemplate x:Key="FacebookScrollViewer" TargetType="{x:Type ScrollViewer}">
		<Grid x:Name="Grid" Background="{TemplateBinding Background}">
			<Grid.ColumnDefinitions>
				<ColumnDefinition Width="*"/>
				<ColumnDefinition Width="Auto"/>
			</Grid.ColumnDefinitions>
			<Grid.RowDefinitions>
				<RowDefinition Height="*"/>
				<RowDefinition Height="Auto"/>
			</Grid.RowDefinitions>
			<Rectangle x:Name="Corner" Grid.Column="1" Fill="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" Grid.Row="1"/>
			<ScrollContentPresenter x:Name="PART_ScrollContentPresenter" CanContentScroll="{TemplateBinding CanContentScroll}" CanHorizontallyScroll="False" CanVerticallyScroll="False" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Grid.Column="0" Margin="{TemplateBinding Padding}" Grid.Row="0"/>
			<ScrollBar x:Name="PART_VerticalScrollBar" AutomationProperties.AutomationId="VerticalScrollBar" Cursor="Arrow" Grid.Column="1" Maximum="{TemplateBinding ScrollableHeight}" Minimum="0" Grid.Row="0" Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}" Value="{Binding VerticalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportHeight}" Style="{DynamicResource ScrollBarStyle1}"/>
			<ScrollBar x:Name="PART_HorizontalScrollBar" AutomationProperties.AutomationId="HorizontalScrollBar" Cursor="Arrow" Grid.Column="0" Maximum="{TemplateBinding ScrollableWidth}" Minimum="0" Orientation="Horizontal" Grid.Row="1" Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" Value="{Binding HorizontalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportWidth}"/>
		</Grid>
	</ControlTemplate>
	<LinearGradientBrush x:Key="VerticalScrollBarBackground" EndPoint="1,0" StartPoint="0,0">
		<GradientStop Color="#E1E1E1" Offset="0"/>
		<GradientStop Color="#EDEDED" Offset="0.20"/>
		<GradientStop Color="#EDEDED" Offset="0.80"/>
		<GradientStop Color="#E3E3E3" Offset="1"/>
	</LinearGradientBrush>
	<SolidColorBrush x:Key="ScrollBarDisabledBackground" Color="#F4F4F4"/>
	<Style x:Key="ScrollBarButton" TargetType="{x:Type RepeatButton}">
		<Setter Property="OverridesDefaultStyle" Value="true"/>
		<Setter Property="Focusable" Value="false"/>
		<Setter Property="IsTabStop" Value="false"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type RepeatButton}">
					<Microsoft_Windows_Themes:ScrollChrome x:Name="Chrome" RenderMouseOver="{TemplateBinding IsMouseOver}" RenderPressed="{TemplateBinding IsPressed}" SnapsToDevicePixels="true" Microsoft_Windows_Themes:ScrollChrome.ScrollGlyph="{TemplateBinding Microsoft_Windows_Themes:ScrollChrome.ScrollGlyph}"/>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	<Style x:Key="VerticalScrollBarPageButton" TargetType="{x:Type RepeatButton}">
		<Setter Property="OverridesDefaultStyle" Value="true"/>
		<Setter Property="Background" Value="Transparent"/>
		<Setter Property="Focusable" Value="false"/>
		<Setter Property="IsTabStop" Value="false"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type RepeatButton}">
					<Rectangle Fill="{TemplateBinding Background}" Height="{TemplateBinding Height}" Width="{TemplateBinding Width}"/>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	<Style x:Key="ScrollBarThumb" TargetType="{x:Type Thumb}">
		<Setter Property="OverridesDefaultStyle" Value="true"/>
		<Setter Property="IsTabStop" Value="false"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type Thumb}">
					<Microsoft_Windows_Themes:ScrollChrome x:Name="Chrome" RenderMouseOver="{TemplateBinding IsMouseOver}" RenderPressed="{TemplateBinding IsDragging}" SnapsToDevicePixels="true" Microsoft_Windows_Themes:ScrollChrome.ScrollGlyph="{TemplateBinding Microsoft_Windows_Themes:ScrollChrome.ScrollGlyph}"/>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	<LinearGradientBrush x:Key="HorizontalScrollBarBackground" EndPoint="0,1" StartPoint="0,0">
		<GradientStop Color="#E1E1E1" Offset="0"/>
		<GradientStop Color="#EDEDED" Offset="0.20"/>
		<GradientStop Color="#EDEDED" Offset="0.80"/>
		<GradientStop Color="#E3E3E3" Offset="1"/>
	</LinearGradientBrush>
	<Style x:Key="HorizontalScrollBarPageButton" TargetType="{x:Type RepeatButton}">
		<Setter Property="OverridesDefaultStyle" Value="true"/>
		<Setter Property="Background" Value="Transparent"/>
		<Setter Property="Focusable" Value="false"/>
		<Setter Property="IsTabStop" Value="false"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type RepeatButton}">
					<Rectangle Fill="{TemplateBinding Background}" Height="{TemplateBinding Height}" Width="{TemplateBinding Width}"/>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	<Style x:Key="FacebookTextStyle" TargetType="{x:Type TextBlock}">
		<Setter Property="TextWrapping" Value="NoWrap"/>
		<Setter Property="TextTrimming" Value="None"/>
		<Setter Property="FontFamily" Value="lucida grande"/>
		<Setter Property="Foreground" Value="#FF3B5998"/>
	</Style>
	<DataTemplate x:Key="commentTemplate">
		<Border BorderBrush="White" BorderThickness="1" MinHeight="66" d:DesignHeight="66" MinWidth="500">
			<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Height="Auto" Background="#FFEDEFF4">
				<Border BorderBrush="{x:Null}" BorderThickness="1" Margin="8,8,0,0" HorizontalAlignment="Left" Width="46" Height="46" Background="White" CornerRadius="2" VerticalAlignment="Top" d:LayoutOverrides="VerticalAlignment">
					<Image x:Name="imgPicture" Width="40" Height="40" Source="{Binding avatar, Mode=OneWay}"/>
				</Border>
				<Grid Margin="50,10,0,0" Width="Auto">
					<Grid.RowDefinitions>
						<RowDefinition Height="*" />					
						<RowDefinition Height="Auto" />
					</Grid.RowDefinitions>
					<Grid Margin="0">
						<Grid.ColumnDefinitions>
							<ColumnDefinition Width="Auto"/>
							<ColumnDefinition Width="*"/>
						</Grid.ColumnDefinitions>
						<TextBlock x:Name="txtFromName" Grid.Column="0" HorizontalAlignment="Left" Margin="7.5,0,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Style="{DynamicResource FacebookTextStyle}" FontWeight="Bold" d:LayoutOverrides="HorizontalAlignment, HorizontalMargin"><Run Language="en-za" Text="{Binding from, Mode=OneWay}"/></TextBlock>
						<TextBlock x:Name="txtMessage" Grid.Column="1" Margin="8,0" TextWrapping="Wrap" VerticalAlignment="Stretch" Style="{DynamicResource FacebookTextStyle}" Foreground="Black" Grid.Row="0"><Run Language="en-za" Text="{Binding message, Mode=OneWay}"/></TextBlock>
					</Grid>
					<Label x:Name="lblcreatedTime" Grid.Row="2" Content="{Binding created_time, Mode=OneWay}" HorizontalAlignment="Stretch" Margin="0" Height="Auto" Foreground="#FF999999" Grid.Column="0" VerticalContentAlignment="Center" d:LayoutOverrides="Width" BorderThickness="8,0,0,0"/>					
				</Grid>
			</Grid>
		</Border>
	</DataTemplate>
	<DataTemplate x:Key="newFeedTemplate">
		<Grid HorizontalAlignment="Left" VerticalAlignment="Stretch" d:DesignWidth="489.5" d:DesignHeight="165.32" MaxWidth="800">
			<Border BorderBrush="{x:Null}" BorderThickness="1" Margin="0" HorizontalAlignment="Left" Width="60" Height="60" Background="White" CornerRadius="2" VerticalAlignment="Top">
				<Image x:Name="imgPicture" Width="50" Height="50" Source="{Binding Path=Picture, Mode=OneWay}"/>
			</Border>
			<Grid Margin="60,10,0,0" Width="Auto">
				<Grid.RowDefinitions>
					<RowDefinition Height="Auto" />
					<RowDefinition Height="Auto" />
					<RowDefinition Height="Auto" />
					<RowDefinition Height="Auto" />
					<RowDefinition Height="Auto" />
				</Grid.RowDefinitions>
				<TextBlock x:Name="txtFromName" HorizontalAlignment="Left" Margin="7.5,0,0,0" TextWrapping="Wrap" Text="{Binding Path=fromName, Mode=OneWay}" VerticalAlignment="Top" Style="{DynamicResource FacebookTextStyle}" FontWeight="Bold"/>
				<TextBlock x:Name="txtMessage" HorizontalAlignment="Left" Margin="7.5,0,0,0" TextWrapping="Wrap" Text="{Binding Path=message, Mode=OneWay}" VerticalAlignment="Stretch" Style="{DynamicResource FacebookTextStyle}" Foreground="Black" Width="Auto" Grid.Row="1"/>
				<Grid Height="Auto" Width="Auto" Margin="0" Grid.Row="3">
					<Grid.ColumnDefinitions>
						<ColumnDefinition Width="Auto"/>
						<ColumnDefinition Width="*" />
					</Grid.ColumnDefinitions>
					<Image x:Name="imgAttributePicture" Height="16" Margin="7.5,3.76,0,3.76" VerticalAlignment="Stretch" Width="Auto" Source="{Binding Path=AttributePicture, Mode=OneWay}"/>
					<Label x:Name="lblcreatedTime" Content="{Binding Path=createdTime, Mode=OneWay}" HorizontalAlignment="Left" Margin="0" Height="Auto" Foreground="#FF999999" Grid.Column="1" VerticalContentAlignment="Center"/>					
				</Grid>
				<Grid x:Name="grdLink" Height="Auto" Width="Auto" Margin="0" Grid.Row="2" d:LayoutOverrides="GridBox" Visibility="{Binding Path=linkAdded, Mode=OneWay}">
					<Grid.ColumnDefinitions>
						<ColumnDefinition Width="Auto"/>
						<ColumnDefinition Width="*" />
					</Grid.ColumnDefinitions>
					<Image x:Name="imgLinkPicture" Grid.Column="0" Height="Auto" Margin="7.5,3.76,0,3.76" VerticalAlignment="Stretch" Width="Auto" Source="{Binding linkPicture, Mode=OneWay}"/>
					<Grid Grid.Column="1" Margin="4,0,0,0" Width="Auto" >
						<Grid.RowDefinitions>
							<RowDefinition Height="Auto"/>
							<RowDefinition Height="Auto"/>
						</Grid.RowDefinitions>
						<TextBlock x:Name="lbllinkTitle" Grid.Row="0" Text="{Binding linkTitle, Mode=OneWay}" HorizontalAlignment="Stretch" Margin="0" Height="Auto" Foreground="#FF3B5998" Grid.Column="1" FontWeight="Bold" />
						<TextBlock x:Name="lbllinkDescription" Grid.Row="1" Text="{Binding linkDescription, Mode=OneWay}" HorizontalAlignment="Stretch" Margin="0" Height="Auto" Foreground="Black" Grid.Column="1"  FontFamily="lucida grande" TextWrapping="Wrap"/>										
					</Grid>					
				</Grid>
				<Grid x:Name="grdComments" Height="Auto" Margin="0" Grid.Row="4" VerticalAlignment="Bottom" Visibility="Visible">
				
					<ItemsControl Height="Auto" Margin="0" Grid.Row="0" VerticalAlignment="Stretch" Width="Auto" d:LayoutOverrides="VerticalAlignment" ItemsSource="{Binding comments, Mode=OneWay}" ItemTemplate="{DynamicResource commentTemplate}"/>
				</Grid>
			</Grid>
		</Grid>
	</DataTemplate>
	<DataTemplate x:Key="wallFeedTemplate">
		<Grid HorizontalAlignment="Left" VerticalAlignment="Stretch" d:DesignWidth="489.5" Height="Auto" Width="Auto" MaxWidth="800">
			<Border BorderBrush="{x:Null}" BorderThickness="1" Margin="0" HorizontalAlignment="Left" Width="60" Height="60" Background="White" CornerRadius="2" VerticalAlignment="Top">
				<Image x:Name="imgPicture" Width="50" Height="50" Source="{Binding avatar, Mode=OneWay}"/>
			</Border>
			<Grid Margin="60,10,0,10" Width="Auto">
				<Grid.RowDefinitions>
					<RowDefinition Height="Auto" />
					<RowDefinition Height="Auto" />
					<RowDefinition Height="Auto" />
				</Grid.RowDefinitions>
				<Grid Margin="0" Grid.Row="0">
					<Grid.ColumnDefinitions>
						<ColumnDefinition Width="Auto"/>
						<ColumnDefinition Width="*" />
					</Grid.ColumnDefinitions>
					<TextBlock x:Name="txtFromName" Grid.Column="0" HorizontalAlignment="Left" Margin="7.5,0,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Style="{DynamicResource FacebookTextStyle}" FontWeight="Bold" d:LayoutOverrides="HorizontalAlignment, HorizontalMargin"><Run Language="en-za" Text="{Binding from, Mode=OneWay}"/></TextBlock>
					<TextBlock x:Name="txtMessage" Grid.Column="1" HorizontalAlignment="Stretch" Margin="8,0" TextWrapping="Wrap" VerticalAlignment="Stretch" Style="{DynamicResource FacebookTextStyle}" Foreground="Black" Width="Auto" ><Run Language="en-za" Text="{Binding message, Mode=OneWay}"/></TextBlock>
				</Grid>
				<Grid Height="Auto" Width="Auto" Margin="0" Grid.Row="1">
					<Image x:Name="imgAttributePicture" Height="16" Margin="7.5,3.76,0,3.76" VerticalAlignment="Stretch" Width="Auto" Source="{Binding AttributePicture, Mode=OneWay}"/>
					<Label x:Name="lblcreatedTime" Content="{Binding created_time, Mode=OneWay}" HorizontalAlignment="Left" Margin="0" Height="Auto" Foreground="#FF999999" Grid.Column="1" VerticalContentAlignment="Center"/>					
				</Grid>
				<Grid x:Name="grdComments" Height="Auto" Margin="10,10,40,0" Grid.Row="2" VerticalAlignment="Bottom" Visibility="Visible">				
					<ItemsControl Height="Auto" Margin="0" Grid.Row="0" VerticalAlignment="Stretch" Width="Auto" d:LayoutOverrides="VerticalAlignment" ItemsSource="{Binding comments, Mode=OneWay}" ItemTemplate="{DynamicResource commentTemplate}">
					</ItemsControl>
				</Grid>
			</Grid>
		</Grid>
	</DataTemplate>
	<DataTemplate x:Key="messagesTemplate">
				<Grid HorizontalAlignment="Left" VerticalAlignment="Stretch" d:DesignWidth="489.5" Height="Auto" Width="Auto" MaxWidth="800">
			<Border BorderBrush="{x:Null}" BorderThickness="1" Margin="0" HorizontalAlignment="Left" Width="60" Height="60" Background="White" CornerRadius="2" VerticalAlignment="Top">
				<Image x:Name="imgPicture" Width="50" Height="50" Source="{Binding fromAvatar, Mode=OneWay}"/>
			</Border>
			<Grid Margin="60,10,0,10" Width="Auto">
				<Grid.RowDefinitions>
					<RowDefinition Height="Auto" />
					
					<RowDefinition Height="Auto" />
					<RowDefinition Height="Auto" />
				</Grid.RowDefinitions>
				<TextBlock x:Name="txtThreadTitle" Grid.Row="0" HorizontalAlignment="Left" Margin="7.5,0,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Style="{DynamicResource FacebookTextStyle}" FontWeight="Bold" d:LayoutOverrides="HorizontalAlignment, HorizontalMargin" Foreground="#FF1842C8"><Run Language="en-za" Text="{Binding subject, Mode=OneWay}"/></TextBlock>
				<TextBlock x:Name="txtfromName" Grid.Row="1" Margin="7.5,0,0,0" TextWrapping="Wrap" VerticalAlignment="Stretch" Style="{DynamicResource FacebookTextStyle}" Foreground="#FF246DE1" Width="Auto" ><Run Language="en-za" Text="{Binding from, Mode=OneWay}"/></TextBlock>
				<TextBlock x:Name="txtMessage" Grid.Row="2" Margin="7.5,0,0,0" TextWrapping="Wrap" VerticalAlignment="Stretch" Style="{DynamicResource FacebookTextStyle}" Foreground="Black" Width="Auto" ><Run Language="en-za" Text="{Binding message, Mode=OneWay}"/></TextBlock>
			</Grid>
		</Grid>
	</DataTemplate>

</ResourceDictionary>